import { writeFiles } from '../filesService';
import { parseTime } from './time';
const os = require('os');
/**
 * 输出方法重写: 接下来会加入log文本输出
 * @param text 用于输出的文本
 */
export const consoleLog = async (text: string, logPath?: string) => {
  const log = `${parseTime(new Date().getTime())}:${os.EOL}${text}`;
  if (logPath) {
    await writeFiles(`${logPath}/log.md`, `${log}` + os.EOL);
  }
  console.log(log);
};
